package com.yf.course.modules.course.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yf.course.modules.course.dto.request.CourseSpeechReqDTO;
import lombok.Data;

/**
 * <p>
 * 课程的讲稿实体类
 * </p>
 */
@Data
@TableName("el_speech")
public class Speech extends Model<Speech> {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 讲稿内容
     */
    @TableField("speech_text")
    private String speechText;

    public Speech() {
    }

    public Speech(CourseSpeechReqDTO courseSpeechReqDTO) {
        this.speechText = courseSpeechReqDTO.getSpeechText();
        if (courseSpeechReqDTO.getSpeechId() != null) {
            this.id = courseSpeechReqDTO.getSpeechId();
        }
    }
    @TableField(exist = false)
    private String courseId;
}
